Skip to content

MPDX-9811 Split NSO and IBS training costs into separate sections - #1949

Open
EJTison wants to merge 2 commits into
mainfrom
MPDX-9811-split-nso-ibs-costs
Open

MPDX-9811 Split NSO and IBS training costs into separate sections#1949
EJTison wants to merge 2 commits into
mainfrom
MPDX-9811-split-nso-ibs-costs

Conversation

@EJTison

@EJTison EJTison commented Jul 28, 2026

Copy link
Copy Markdown

Description

The Edit Training Costs modal in the MPD Goal Calculator admin captured NSO and IBS as a single combined "NSO & IBS Cost" section. That made it impossible to price a cohort for someone who attends NSO but not IBS — and it left two backend columns with no way to be filled.

This splits that one section into two:

  • NSO Cost — Individual (1 in room), Individual (2 in room), Couple, Family (unchanged, just no longer carrying IBS)
  • IBS Cost — Single, Couple (new)

The modal goes from 11 to 13 fields, matching the design and the API.

Why this lands separately from MPDX-9701

The modal itself shipped in #1894 (MPDX-9701). On the same day it merged, Caleb left Figma comment #127 on the modal's design node:

"I think we need some extra fields to be able to calculate how much it costs for someone to attend NSO but not IBS. I think 'NSO & IBS Cost' should be 'NSO Cost' and we need a new IBS row with single and couple inputs."

The design was updated to match, but the modal wasn't. This is that follow-up.

Field naming

The keys now line up one-for-one with NewStaffCohort::COST_FIELDS in mpdx_api (added in CruGlobal/mpdx_api#3425), so ibs_single_cost and ibs_couple_cost have somewhere to come from once the cohort API exists:

Backend column Frontend key
nso_individual_1_in_room_cost nsoIndividual1InRoom
nso_individual_2_in_room_cost nsoIndividual2InRoom
nso_couple_cost nsoCouple
nso_family_cost nsoFamily
ibs_single_cost ibsSingle
ibs_couple_cost ibsCouple
refresh_retreat_{single,couple}_cost refreshRetreat{Single,Couple}
faith_and_finance_{single,couple}_cost faithAndFinance{Single,Couple}
cru_conference_{single,couple,family}_cost cruConference{Single,Couple,Family}
Why the keys don't carry the columns' _cost suffix

Every backend column ends in _cost, but the pre-existing frontend keys never did (refreshRetreatSingle, not refreshRetreatSingleCost). Keeping the file's existing convention means this diff touches the 4 NSO keys plus the 2 new IBS ones, instead of churning 7 untouched fields for no functional gain. These keys are mock-only today — codegen will supersede them when the cohort API lands.

Testing

MpdGoalAdmin is still a mock-data prototype with no GraphQL wiring, so there's nothing to persist yet — this is UI plus types.

  • Go to HR Tools → MPD Goal Calculator Admin Table
  • In the cohort bar, under Training Cost, click View/Edit
  • Confirm the modal now shows NSO Cost (4 inputs) and a separate IBS Cost (Single, Couple), 13 in total
  • Confirm Apply stays disabled until all 13 are valid, then applies and prefills on reopen

Automated: the modal's tests assert each input by its (section, label) identity rather than positional index, so onSave receiving the expected object genuinely proves every labelled input maps to its intended key — including the two new IBS ones.

Out of scope

EditTrainingCostsModal still uses a hand-rolled MUI Dialog rather than the shared src/components/Shared/Modal that its sibling AssignCoachModal uses. Worth aligning, but it would bury this change — leaving it for a follow-up.

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels (Add the label "Preview" to automatically create a preview environment)
  • I have run the Claude Code /pr-review command locally and fixed any relevant suggestions
  • I have requested a review from another person on the project
  • I have tested my changes in preview or in staging
  • I have cleaned up my commit history

Related ticket: MPDX-9811

🤖 Generated with Claude Code

EJTison and others added 2 commits July 28, 2026 17:12
The Edit Training Costs modal captured NSO and IBS as one combined
"NSO & IBS Cost" section, so a cohort could not be priced for an
attendee who goes to NSO but not IBS.

Splits the section into "NSO Cost" (unchanged four room/household
types) and a new "IBS Cost" (Single, Couple), taking the modal from
11 to 13 fields. The keys now mirror NewStaffCohort::COST_FIELDS in
mpdx_api one-for-one, so the modal can populate ibs_single_cost and
ibs_couple_cost once the cohort API lands.

Requested by Caleb Cox in Figma comment 127 on node 789-32532, after
MPDX-9701 had already merged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Section order is what this change is actually about, so assert the
headings as an ordered list rather than checking each is merely
present. Verified the assertion fails when a heading is reordered
or renamed.

Also drops a stale "11 cost fields" count and rewords the
TrainingCosts doc so it no longer implies the frontend keys are a
mechanical suffix-stripping of the columns, and notes the columns
are nullable while these fields are required.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against 0a0f7c3

No significant changes found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant